#pragma once
#include <QGraphicsObject>

class GameButton : public QGraphicsObject
{
   Q_OBJECT

public:

   GameButton(const QString& fileName, const QString& buttonString, QGraphicsItem *parent = 0);

   ~GameButton();
   
   virtual QRectF boundingRect() const;

protected:

   virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);

   virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);

   virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);

   virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);

   virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget /* = 0 */);

private:

   void init();

   QPixmap m_pixmap;

   bool m_pressed;

   bool m_hovered;

   const QFont m_font;

   const QColor m_fontColor;

   boost::shared_ptr<QPen> m_fontPen;

   const QString m_buttonString;
signals:

    void clicked();


};
